home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / sbin / ntpdate-debian < prev    next >
Text File  |  2009-10-22  |  531b  |  24 lines

  1. #!/bin/sh
  2.  
  3. set -e
  4.  
  5. if [ -r /etc/default/ntpdate ]; then
  6.     . /etc/default/ntpdate
  7. fi
  8.  
  9. if [ "$NTPDATE_USE_NTP_CONF" = yes ]; then
  10.     for f in /etc/ntp.conf.dhcp /etc/ntp.conf /etc/openntpd/ntpd.conf; do
  11.         if [ -r "$f" ]; then
  12.             file=$f
  13.             break
  14.         fi
  15.     done
  16.     if [ -n "$file" ]; then
  17.         NTPSERVERS=$(sed -rne 's/^(servers?|peer) ([-_.:[:alnum:]]+).*$/\2/p' "$file" | grep -v '^127\.127\.') || [ $? -le 1 ]
  18.     fi
  19. elif [ -r /etc/default/ntpdate.dhcp ]; then
  20.     . /etc/default/ntpdate.dhcp
  21. fi
  22.  
  23. exec /usr/sbin/ntpdate $NTPOPTIONS "$@" $NTPSERVERS
  24.